var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2DataManager = require("DataManager");
var $2Jiangshibwz = require("Jiangshibwz");
var $2Role1 = require("Role1");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var c;
(function (e) {
  e[e.norm = 0] = "norm";
  e[e.die = 1] = "die";
})(c || (c = {}));
var def_Zidan = /* */function (_cc$Component84) {
  babel_inherits(d, _cc$Component84);
  var _super103 = babel_createSuper(d);
  function d() {
    var _this243;
    babel_classCallCheck(this, d);
    _this243 = _super103.apply(this, arguments);
    _this243.speed = 100;
    return _this243;
  }
  babel_createClass(d, [{
    key: "start",
    value: function start() {}
  }, {
    key: "onCollisionEnter",
    value: function onCollisionEnter(e, t) {
      if (e.node.getComponent($2Jiangshibwz.default).speed && t.node.parent) {
        e.node.getComponent($2Jiangshibwz.default).hp_js -= t.node.parent.getComponent($2Role1.default).sheji_hurt;
        if (e.node.getComponent($2Jiangshibwz.default).hp_js <= 0) {
          e.node.getComponent($2Jiangshibwz.default).state = c.die, e.node.getComponent($2Jiangshibwz.default).speed = 0, e.node.getComponent(sp.Skeleton).setAnimation(0, "die", false), e.node.getComponent(sp.Skeleton).setCompleteListener(function (t) {
            "die" == t.animation.name && e.node.removeFromParent();
          });
        }
        t.node.removeFromParent();
      }
    }
  }, {
    key: "update",
    value: function update(e) {
      $2DataManager.default.instance.is_over || (this.node.x += this.speed);
    }
  }]);
  return d;
}(cc.Component);
def_Zidan = cc__decorate([ccp_ccclass], def_Zidan);
exports.default = def_Zidan;